Optimal. Leaf size=57 \[ -\frac{a^2 \sin ^3(c+d x)}{3 d}+\frac{2 a^2 \sin (c+d x)}{d}+\frac{a^2 \sin (c+d x) \cos (c+d x)}{d}+a^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0414491, antiderivative size = 69, normalized size of antiderivative = 1.21, number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {2751, 2644} \[ \frac{4 a^2 \sin (c+d x)}{3 d}+\frac{a^2 \sin (c+d x) \cos (c+d x)}{3 d}+a^2 x+\frac{\sin (c+d x) (a \cos (c+d x)+a)^2}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2751
Rule 2644
Rubi steps
\begin{align*} \int \cos (c+d x) (a+a \cos (c+d x))^2 \, dx &=\frac{(a+a \cos (c+d x))^2 \sin (c+d x)}{3 d}+\frac{2}{3} \int (a+a \cos (c+d x))^2 \, dx\\ &=a^2 x+\frac{4 a^2 \sin (c+d x)}{3 d}+\frac{a^2 \cos (c+d x) \sin (c+d x)}{3 d}+\frac{(a+a \cos (c+d x))^2 \sin (c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.079044, size = 41, normalized size = 0.72 \[ \frac{a^2 (21 \sin (c+d x)+6 \sin (2 (c+d x))+\sin (3 (c+d x))+12 d x)}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.039, size = 64, normalized size = 1.1 \begin{align*}{\frac{1}{d} \left ({\frac{{a}^{2} \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}}+2\,{a}^{2} \left ( 1/2\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) +1/2\,dx+c/2 \right ) +{a}^{2}\sin \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.12368, size = 82, normalized size = 1.44 \begin{align*} -\frac{2 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{2} - 3 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2} - 6 \, a^{2} \sin \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.70289, size = 113, normalized size = 1.98 \begin{align*} \frac{3 \, a^{2} d x +{\left (a^{2} \cos \left (d x + c\right )^{2} + 3 \, a^{2} \cos \left (d x + c\right ) + 5 \, a^{2}\right )} \sin \left (d x + c\right )}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.609382, size = 107, normalized size = 1.88 \begin{align*} \begin{cases} a^{2} x \sin ^{2}{\left (c + d x \right )} + a^{2} x \cos ^{2}{\left (c + d x \right )} + \frac{2 a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac{a^{2} \sin{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac{a^{2} \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{d} + \frac{a^{2} \sin{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a \cos{\left (c \right )} + a\right )^{2} \cos{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.34546, size = 73, normalized size = 1.28 \begin{align*} a^{2} x + \frac{a^{2} \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac{a^{2} \sin \left (2 \, d x + 2 \, c\right )}{2 \, d} + \frac{7 \, a^{2} \sin \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]